package com.water.controller.wx;

import com.water.service.wx.Wx_JuBaoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.HashMap;
import java.util.Map;

@Controller
@RequestMapping("wx")
public class Wx_JuBaoApi {
    @Autowired
    Wx_JuBaoService wx_juBaoService;


    @RequestMapping(value = "jubao",method = RequestMethod.POST)
    @ResponseBody
    public String jubao(@RequestBody Map map){
        System.out.println(map.toString());
        System.out.println(map.get("json"));
        int n=wx_juBaoService.insertJuBao(map);
        if(n==0){
            return "fail";
        }
        return "success";
    }


    @ResponseBody
    @RequestMapping(value = "/a",method = RequestMethod.GET)
    public String test(){
        return "test";
    }
}
